package mediaServer;

import mediaServer.logic.MediaModule;
import mediaServer.configurationManagement.ConfigurationManager;
import mediaServer.connection.ConnectionManager;
import mediaServer.logic.MediaManagerInterface;

/**
 * Initial calls for creating and managing the mediaServer.
 * Containts the testing functions and the evaluation processes for the creation of the instances for the media management
 * @version 0.1 (Development-Early Alpha)
 * @author Gonzalo Canelada Purcell
 * @date 28 September 2009
 */
public class InitiateMS {

	/**
	 * Handles the configuration information stored in the local file
	 */
	private ConfigurationManager configM = null;
	/**
	 * Handles the communications between the ApplicationServer and the clients
	 */
	private ConnectionManager connM = null;
	/**
	 * Handles the media streamer instance
	 */
	private MediaModule mediaM = null;
	
	public InitiateMS() {
		configM = createConfigurationManager();
		connM = createConnectionManager(configM);
		mediaM = createMediaManager(configM);
	}
	
	private ConfigurationManager createConfigurationManager(){
		return  new ConfigurationManager();
	}

	private ConnectionManager createConnectionManager(ConfigurationManager _configM){
		return new ConnectionManager(_configM.get_config());
	}
	
	private MediaModule createMediaManager(ConfigurationManager _configM){
		return new MediaModule(_configM.get_config());
	}
	
	
	public static void main(String[] args) {
		new InitiateMS();
	}
}
